<?
if (!defined('MODULE_FILE')){
die ("cant access file directly!");
}
require_once 'class/EmpRegister.php';

$mid=$_GET['mid'];
$smid=$_GET['smid'];
?>
<?
$att = new EmpRegister();
$result = $att->AllList();
?>
<script type="text/javascript">
 $(document).ready(function() {
  $("#aa").click(function (e) {

   //removes spaces from username
    var uid = $('#aa').val(); 
   $.post('checkemailexist_supp.php', {'uid':uid}, function(data) {
     $("#suppresult").html(data);
   });
   

  }); 
 });
</script>
<link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script>
    $(document).ready(function() {
        $('#dataTables-example').dataTable();
    });
    </script>
	<style>
	.thclass{
	font-size:12px;
	}
	.tbclass{
	font-size:12px;
	}
	</style>
<br>
<br>
	<div class="col-lg-12">
	<div class="panel panel-primary">
		
		<div class="panel-heading"><i class="fa fa-bell fa-fw"></i>User's List</div>
		<div class="panel-body">
			<div class="table-responsive">
				<table class="table table-striped table-bordered table-hover" id="dataTables-example">
					<thead class="thclass">
						<tr>
							<th>Sr.No</th>
							<th >Login Id</th>
							<th>Name</th>
							<th>Department</th>
							<th>Reporting Manager</th>
							<th>Date of Join</th>
							<th>Cab Status</th>
							<th>Status</th>
							<th>Update</th>
							<th>Mail Send</th>
					</thead>
					<tbody class="tbclass">
					<?php 
					for ($i = 0; $i <= count($result); $i++)
					{			$uid=$result[$i]['id'];
								$rptuid=$result[$i]['reporting_mgr'];
								$n++;
								
								$resultRpt = $att->getReportMgr($rptuid);
								if($result[$i]['emp_status']==0){ $ests= "Active";}else{ $ests= "Not Active";}
								?>
								<tr class="odd gradeX">
								<td><?  echo $i; ?></td>
								<td><? echo $result[$i]['Login'];?></td>
								<td><? echo $result[$i]['Name'];?></td>
								<td><? echo $result[$i]['department_name'];?></td>
								<td><? echo $resultRpt[0]['Name'];?></td>
								<td><? echo date("d-M-Y",strtotime($result[$i]['dt_ofjoin']));?></td>
								<td><? echo $result[$i]['cab_status'];?></td>
								<td><? echo $ests;?></td>
								<td><a href="modules.php?file=user_add_hr&id=<? echo $uid; ?>&mid=<? echo $mid;?>&smid=<? echo $smid;?>">Detail</a></td>
								<td><input type="checkbox" name="aa" id="aa" value="<?php echo $result[$i]['id'];?>" /></td>
								</tr>
					<?
					} 
					?>
							 </tbody>
                            </table>
                            </div>
                        </div>
                    </div>
                </div>